package Controller;

import Service.CustomerService;
import pojo.Customer;

import java.sql.SQLException;
import java.util.List;

public class CustomerController {
    private CustomerService customerService;

    public CustomerController() throws Exception {
        customerService = new CustomerService();
    }
    //管理员获取所有信息，查询所有顾客
    public List<Customer> getAllCustomer() throws Exception {
        List<Customer> customerList = customerService.getAllCustomer();
        return customerList;
    }

    //删除顾客
    public void deletecustomer(int del_customerid) throws Exception {
        customerService.deletecustomer(del_customerid);
    }

    //查询部分顾客
    public List<Customer> geUserName(String searchText) throws Exception {
        return customerService.geUserName(searchText);
    }

    //管理员添加客户信息
    public Boolean addcustomer(Customer customer) throws Exception {
        return customerService.addcustomer(customer);
    }

    //管理员取消订单个人信息更新车辆数量
    public void updateCustomerStatus(int userId) throws Exception {
        customerService.updateCustomerStatus(userId);
    }

    public void updatecustomerById(int data_id, Customer customer) throws Exception {
        customerService.updatecustomerById(data_id,customer);
    }
}
